package cn.highset.modules.base.service.mybatis;

import cn.highset.modules.base.entity.User;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.Cacheable;

/**
 * @author Victor
 */
@CacheConfig(cacheNames = "user")
public interface IUserService extends IService<User> {

    /**
     * 通过用户名获取用户ID
     *
     * @param username
     * @return
     */
    @Cacheable(key = "'getid:'+#username")
    String findIdByUsername(String username);
}
